package com.lagou.task10;

public class DirectionTest {

    public static void main(String[] args) {

        // 1.声明Direction类型的引用指向该类型的对象并打印
        /*Direction d1 = new Direction("向上");
        System.out.println("获取的方向是：" + d1.getDesc());

        Direction d2 = new Direction("向下");
        System.out.println("获取的方向是：" + d2.getDesc());

        Direction d3 = new Direction("向左");
        System.out.println("获取的方向是：" + d3.getDesc());

        Direction d4 = new Direction("向右");
        System.out.println("获取的方向是：" + d4.getDesc());

        Direction d5 = new Direction("向前");
        System.out.println("获取的方向是：" + d5.getDesc());*/

        //Direction d1 = 2; 类型不匹配
        //Direction d1 = null; Error final关键字修饰
        Direction d1 = Direction.UP;
        System.out.println("获取的方向是：" + d1.getDesc());

        System.out.println("-----------------------------------------");
        // 使用一下java5开始的枚举类型
        Direction de = Direction.DOWN;
        System.out.println("获取的方向是：" + de.getDesc());
    }
}
